from pyparsing import *

lowercaseRegex = "[a-z][a-zA-Z0-9]*"

uppercaseRegex = "[A-Z][a-zA-Z0-9]*"

LowercaseIdentifier = Regex(lowercaseRegex)

UppercaseIdentifier = Regex(uppercaseRegex)

def combine(x): return "".join([str(i) for i in x])

def strJoin(x): return "".join([i for i in x])

def lit(string):
  return Suppress(Literal(string))

def addSeparator(x, sep):
  x = x.asList()
  i = 0
  while i != len(x) - 1:
    if x[i] != "":
      x.insert(i+1, sep)
      i = i+2
    else: i = i+1
  return x

def addSpace(x, index):
  x = x.asList()
  x.insert(index, " ")
  return x
